<?php
	class Catalog_model extends CI_Model {
		public $table_name="catalog";
    public function get_all()
    {
        $catalogs = $this->db->get('catalog');
        return $catalogs->result();
    }
    public function get_one($id)
    {
        $catalog = $this->db->where("id",$id)->get($this->table_name);
        $c= $catalog->result();
        return $c[0];
    }
       
    	
        public function add_one($data)
    {   
        
        $this->db->insert($this->table_name,$data);
    }
        
        public function edit_one($id,$data)
    {
        
         $this->db->where('id',$id)->update($this->table_name,$data);
    }
        public function delete_one($id)
    {
        $this->db->where('id',$id)->delete($this->table_name);
    }
   
}

    
